home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Technology Seed / ATS July '97.toast / Mac OS 8 / Docs-Interfaces-Libs / Appearance Manager / Appearance.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-10  |  71.2 KB  |  1,767 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Appearance.h
  3.  
  4.      Contains:    Appearance Manager APIs
  5.  
  6.      Version:    Technology:    Appearance 1.0
  7.                  Release:    Tempo
  8.  
  9.      Copyright:    © 1984-1997 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __APPEARANCE__
  19. #define __APPEARANCE__
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. #ifndef __WINDOWS__
  28. #include <Windows.h>
  29. #endif
  30. #ifndef __DIALOGS__
  31. #include <Dialogs.h>
  32. #endif
  33. #ifndef __FILES__
  34. #include <Files.h>
  35. #endif
  36. #ifndef __ICONS__
  37. #include <Icons.h>
  38. #endif
  39. #ifndef __CONTROLS__
  40. #include <Controls.h>
  41. #endif
  42. #ifndef __TEXTEDIT__
  43. #include <TextEdit.h>
  44. #endif
  45. #ifndef __QDOFFSCREEN__
  46. #include <QDOffscreen.h>
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT_SUPPORTED
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_ALIGN_SUPPORTED
  58. #pragma options align=mac68k
  59. #endif
  60.  
  61. typedef UInt32 TextEncoding;
  62. /*——————————————————————————————————————————————————————————————————————————————————*/
  63. /* Appearance Manager constants, etc.                                                */
  64. /*——————————————————————————————————————————————————————————————————————————————————*/
  65.  
  66. enum {
  67.                                                                 /* Appearance Trap Number */
  68.     _AppearanceDispatch            = 0xAA74
  69. };
  70.  
  71. /* Gestalt selector and values for the Appearance Manager */
  72.  
  73. enum {
  74.     gestaltAppearanceAttr        = 'appr',
  75.     gestaltAppearanceExists        = 0,
  76.     gestaltAppearanceCompatMode    = 1
  77. };
  78.  
  79. /* Appearance Manager Error Codes */
  80.  
  81. enum {
  82.     appearanceBadBrushIndexErr    = -30560,                        /* pattern index invalid */
  83.     appearanceProcessRegisteredErr = -30561,
  84.     appearanceProcessNotRegisteredErr = -30562,
  85.     appearanceBadTextColorIndexErr = -30563
  86. };
  87.  
  88.  
  89. enum {
  90.     kThemeActiveDialogBackgroundBrush = 1,                        /* Dialogs */
  91.     kThemeInactiveDialogBackgroundBrush = 2,                    /* Dialogs */
  92.     kThemeActiveAlertBackgroundBrush = 3,
  93.     kThemeInactiveAlertBackgroundBrush = 4,
  94.     kThemeActiveModelessDialogBackgroundBrush = 5,
  95.     kThemeInactiveModelessDialogBackgroundBrush = 6,
  96.     kThemeActiveUtilityWindowBackgroundBrush = 7,                /* Miscellaneous */
  97.     kThemeInactiveUtilityWindowBackgroundBrush = 8,                /* Miscellaneous */
  98.     kThemeListViewSortColumnBackgroundBrush = 9,                /* Finder */
  99.     kThemeListViewBackgroundBrush = 10,
  100.     kThemeIconLabelBackgroundBrush = 11,
  101.     kThemeListViewSeparatorBrush = 12,
  102.     kThemeChasingArrowsBrush    = 13,
  103.     kThemeDragHiliteBrush        = 14,
  104.     kThemeDocumentWindowBackgroundBrush = 15,
  105.     kThemeFinderWindowBackgroundBrush = 16
  106. };
  107.  
  108. typedef SInt16 ThemeBrush;
  109.  
  110. enum {
  111.     kThemeActiveDialogTextColor    = 1,                            /* Dialogs */
  112.     kThemeInactiveDialogTextColor = 2,
  113.     kThemeActiveAlertTextColor    = 3,
  114.     kThemeInactiveAlertTextColor = 4,
  115.     kThemeActiveModelessDialogTextColor = 5,
  116.     kThemeInactiveModelessDialogTextColor = 6,
  117.     kThemeActiveWindowHeaderTextColor = 7,                        /* Primitives */
  118.     kThemeInactiveWindowHeaderTextColor = 8,
  119.     kThemeActivePlacardTextColor = 9,                            /* Primitives */
  120.     kThemeInactivePlacardTextColor = 10,
  121.     kThemePressedPlacardTextColor = 11,
  122.     kThemeActivePushButtonTextColor = 12,                        /* Primitives */
  123.     kThemeInactivePushButtonTextColor = 13,
  124.     kThemePressedPushButtonTextColor = 14,
  125.     kThemeActiveBevelButtonTextColor = 15,                        /* Primitives */
  126.     kThemeInactiveBevelButtonTextColor = 16,
  127.     kThemePressedBevelButtonTextColor = 17,
  128.     kThemeActivePopupButtonTextColor = 18,                        /* Primitives */
  129.     kThemeInactivePopupButtonTextColor = 19,
  130.     kThemePressedPopupButtonTextColor = 20,
  131.     kThemeIconLabelTextColor    = 21,                            /* Finder */
  132.     kThemeListViewTextColor        = 22
  133. };
  134.  
  135. typedef SInt16 ThemeTextColor;
  136. /* States to draw primitives: disabled, active, and pressed (hilited) */
  137.  
  138. enum {
  139.     kThemeStateDisabled            = 0,
  140.     kThemeStateActive            = 1,
  141.     kThemeStatePressed            = 2
  142. };
  143.  
  144. typedef UInt32 ThemeDrawState;
  145. /*——————————————————————————————————————————————————————————————————————————————————*/
  146. /* Window Manager constants, etc.                                                    */
  147. /*——————————————————————————————————————————————————————————————————————————————————*/
  148.  
  149. enum {
  150.                                                                 /* Resource IDs for new window defprocs */
  151.     kWindowDocumentDefProcResID    = 64,
  152.     kWindowDialogDefProcResID    = 65,
  153.     kWindowUtilityDefProcResID    = 66,
  154.     kWindowUtilitySideTitleDefProcResID = 67
  155. };
  156.  
  157.  
  158. enum {
  159.                                                                 /* Proc IDs for theme-savvy windows */
  160.     kWindowDocumentProc            = 1024,
  161.     kWindowGrowDocumentProc        = 1025,
  162.     kWindowVertZoomDocumentProc    = 1026,
  163.     kWindowVertZoomGrowDocumentProc = 1027,
  164.     kWindowHorizZoomDocumentProc = 1028,
  165.     kWindowHorizZoomGrowDocumentProc = 1029,
  166.     kWindowFullZoomDocumentProc    = 1030,
  167.     kWindowFullZoomGrowDocumentProc = 1031
  168. };
  169.  
  170.  
  171. enum {
  172.                                                                 /* Proc IDs for theme-savvy dialogs */
  173.     kWindowPlainDialogProc        = 1040,
  174.     kWindowShadowDialogProc        = 1041,
  175.     kWindowModalDialogProc        = 1042,
  176.     kWindowMovableModalDialogProc = 1043,
  177.     kWindowAlertProc            = 1044,
  178.     kWindowMovableAlertProc        = 1045
  179. };
  180.  
  181.  
  182. enum {
  183.                                                                 /* Proc IDs for top title bar theme-savvy floating windows */
  184.     kWindowFloatProc            = 1057,
  185.     kWindowFloatGrowProc        = 1059,
  186.     kWindowFloatVertZoomProc    = 1061,
  187.     kWindowFloatVertZoomGrowProc = 1063,
  188.     kWindowFloatHorizZoomProc    = 1065,
  189.     kWindowFloatHorizZoomGrowProc = 1067,
  190.     kWindowFloatFullZoomProc    = 1069,
  191.     kWindowFloatFullZoomGrowProc = 1071
  192. };
  193.  
  194.  
  195. enum {
  196.                                                                 /* Proc IDs for side title bar theme-savvy floating windows */
  197.     kWindowFloatSideProcID        = 1073,
  198.     kWindowFloatSideGrowProcID    = 1075,
  199.     kWindowFloatSideVertZoomProcID = 1077,
  200.     kWindowFloatSideVertZoomGrowProcID = 1079,
  201.     kWindowFloatSideHorizZoomProcID = 1081,
  202.     kWindowFloatSideHorizZoomGrowProcID = 1083,
  203.     kWindowFloatSideFullZoomProcID = 1085,
  204.     kWindowFloatSideFullZoomGrowProcID = 1087
  205. };
  206.  
  207.  
  208. enum {
  209.                                                                 /* Region values to pass into GetWindowRegion */
  210.     kWindowTitleBarRgn            = 0,
  211.     kWindowTitleTextRgn            = 1,
  212.     kWindowCloseBoxRgn            = 2,
  213.     kWindowZoomBoxRgn            = 3,
  214.     kWindowDragRgn                = 5,
  215.     kWindowGrowRgn                = 6,
  216.     kWindowCollapseBoxRgn        = 7,
  217.     kWindowStructureRgn            = 32,
  218.     kWindowContentRgn            = 33
  219. };
  220.  
  221. typedef UInt16 WindowRegionCode;
  222.  
  223. enum {
  224.                                                                 /* Window Features returned by GetWindowFeatures */
  225.     kWindowCanGrow                = (1 << 0),
  226.     kWindowCanZoom                = (1 << 1),
  227.     kWindowCanCollapse            = (1 << 2),
  228.     kWindowIsModal                = (1 << 3),
  229.     kWindowCanGetWindowRegion    = (1 << 4),
  230.     kWindowIsAlert                = (1 << 5),
  231.     kWindowHasTitleBar            = (1 << 6)
  232. };
  233.  
  234.  
  235. enum {
  236.                                                                 /* New window messages */
  237.     kWindowMsgGetFeatures        = 7,
  238.     kWindowMsgGetRegion            = 8
  239. };
  240.  
  241.  
  242. enum {
  243.                                                                 /* New Window part codes */
  244.     inCollapseBox                = 11
  245. };
  246.  
  247.  
  248. enum {
  249.                                                                 /* Window Definition hit test result codes ("WindowPart")*/
  250.     wInCollapseBox                = 9
  251. };
  252.  
  253. /* Window positioning constants */
  254.  
  255. enum {
  256.     kWindowDefaultPosition        = 0x0000,
  257.     kWindowCenterMainScreen        = 0x280A,
  258.     kWindowAlertPositionMainScreen = 0x300A,
  259.     kWindowStaggerMainScreen    = 0x380A,
  260.     kWindowCenterParentWindow    = 0xA80A,
  261.     kWindowAlertPositionParentWindow = 0xB00A,
  262.     kWindowStaggerParentWindow    = 0xB80A,
  263.     kWindowCenterParentWindowScreen = 0x680A,
  264.     kWindowAlertPositionParentWindowScreen = 0x700A,
  265.     kWindowStaggerParentWindowScreen = 0x780A
  266. };
  267.  
  268. /* GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion */
  269. struct GetWindowRegionRec {
  270.     RgnHandle                         winRgn;
  271.     WindowRegionCode                 regionCode;
  272. };
  273. typedef struct GetWindowRegionRec GetWindowRegionRec;
  274.  
  275. typedef GetWindowRegionRec *GetWindowRegionPtr;
  276. /*——————————————————————————————————————————————————————————————————————————————————*/
  277. /* Dialog Manager constants, etc.                                                    */
  278. /*——————————————————————————————————————————————————————————————————————————————————*/
  279.  
  280. enum {
  281.                                                                 /* Alert types to pass into StandardAlert */
  282.     kAlertStopAlert                = 0,
  283.     kAlertNoteAlert                = 1,
  284.     kAlertCautionAlert            = 2,
  285.     kAlertPlainAlert            = 3
  286. };
  287.  
  288. typedef SInt16 AlertType;
  289.  
  290. enum {
  291.     kAlertDefaultOKText            = -1,                            /* "OK"*/
  292.     kAlertDefaultCancelText        = -1,                            /* "Cancel"*/
  293.     kAlertDefaultOtherText        = -1                            /* "Don't Save"*/
  294. };
  295.  
  296. /* StandardAlert alert button numbers */
  297.  
  298. enum {
  299.     kAlertStdAlertOKButton        = 1,
  300.     kAlertStdAlertCancelButton    = 2,
  301.     kAlertStdAlertOtherButton    = 3,
  302.     kAlertStdAlertHelpButton    = 4
  303. };
  304.  
  305.  
  306. enum {
  307.                                                                 /* Dialog Flags for use in NewFeaturesDialog or dlgx resource */
  308.     kDialogFlagsUseThemeBackground = (1 << 0),
  309.     kDialogFlagsUseControlHierarchy = (1 << 1),
  310.     kDialogFlagsHandleMovableModal = (1 << 2),
  311.     kDialogFlagsUseThemeControls = (1 << 3)
  312. };
  313.  
  314.  
  315. enum {
  316.                                                                 /* Alert Flags for use in alrx resource */
  317.     kAlertFlagsUseThemeBackground = (1 << 0),
  318.     kAlertFlagsUseControlHierarchy = (1 << 1),
  319.     kAlertFlagsAlertIsMovable    = (1 << 2),
  320.     kAlertFlagsUseThemeControls    = (1 << 3)
  321. };
  322.  
  323. /* For dftb resource */
  324.  
  325. enum {
  326.     kDialogFontNoFontStyle        = 0,
  327.     kDialogFontUseFontMask        = 0x0001,
  328.     kDialogFontUseFaceMask        = 0x0002,
  329.     kDialogFontUseSizeMask        = 0x0004,
  330.     kDialogFontUseForeColorMask    = 0x0008,
  331.     kDialogFontUseBackColorMask    = 0x0010,
  332.     kDialogFontUseModeMask        = 0x0020,
  333.     kDialogFontUseJustMask        = 0x0040,
  334.     kDialogFontUseAllMask        = 0x00FF,
  335.     kDialogFontAddFontSizeMask    = 0x0100,
  336.     kDialogFontUseFontMaskMask    = 0x0200
  337. };
  338.  
  339. struct AlertStdAlertParamRec {
  340.     Boolean                         movable;                    /* Make alert movable modal */
  341.     Boolean                         helpButton;                    /* Is there a help button? */
  342.     ModalFilterUPP                     filterProc;                    /* Event filter */
  343.     StringPtr                         defaultText;                /* Text for button in OK position */
  344.     StringPtr                         cancelText;                    /* Text for button in cancel position */
  345.     StringPtr                         otherText;                    /* Text for button in left position */
  346.     SInt16                             defaultButton;                /* Which button behaves as the default */
  347.     SInt16                             cancelButton;                /* Which one behaves as cancel (can be 0) */
  348.     UInt16                             position;                    /* Position (kWindowDefaultPosition in this case */
  349.                                                                 /* equals kWindowAlertPositionParentWindowScreen) */
  350. };
  351. typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
  352.  
  353. typedef AlertStdAlertParamRec *AlertStdAlertParamPtr;
  354. /*——————————————————————————————————————————————————————————————————————————————————*/
  355. /* Control Manager constants, etc.                                                    */
  356. /*——————————————————————————————————————————————————————————————————————————————————*/
  357.  
  358. enum {
  359.     _ControlDispatch            = 0xAA73
  360. };
  361.  
  362.  
  363. enum {
  364.                                                                 /* resource types for new controls */
  365.     kControlTabListResType        = 'tab#',                        /* used for tab control only*/
  366.     kControlListDescResType        = 'ldes'                        /* used for list box control only*/
  367. };
  368.  
  369.  
  370. enum {
  371.                                                                 /* new part codes for new controls */
  372.     kControlEditTextPart        = 5,
  373.     kControlPicturePart            = 6,
  374.     kControlIconPart            = 7,
  375.     kControlClockPart            = 8,
  376.     kControlListBoxPart            = 24,
  377.     kControlListBoxDoubleClickPart = 25
  378. };
  379.  
  380.  
  381. enum {
  382.     kControlSupportsNewMessages    = ' ok '                        /* CDEF should return as result of kControlMsgTestNewMsgSupport*/
  383. };
  384.  
  385. /* focusing part codes */
  386.  
  387. enum {
  388.     kControlFocusNoPart            = 0,                            /* tells control to clear its focus*/
  389.     kControlFocusNextPart        = -1,                            /* tells control to focus on the next part*/
  390.     kControlFocusPrevPart        = -2                            /* tells control to focus on the previous part*/
  391. };
  392.  
  393. typedef SInt16 ControlFocusPart;
  394. /* Key Filter result codes                                                             */
  395. /*                                                                                    */
  396. /* Certain controls can have a keyfilter attached to them. The filter proc should    */
  397. /* return one of the two constants below. If kKeyFilterBlockKey is returned, the    */
  398. /* key is blocked and never makes it to the control. If kKeyFilterPassKey is        */
  399. /* returned, the control receives the keystroke.                                    */
  400.  
  401. enum {
  402.     kControlKeyFilterBlockKey    = 0,
  403.     kControlKeyFilterPassKey    = 1
  404. };
  405.  
  406. typedef SInt16 ControlKeyFilterResult;
  407. /*——————————————————————————————————————————————————————————————————————————————————————*/
  408. /*
  409.      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  410.     The constants below are meta-font numbers which you can use to set a particular
  411.     control's font usage. There are essentially two modes you can use: 1) default,
  412.     which is essentially the same as it always has been, i.e. it uses the system font, unless
  413.     directed to use the window font via a control variant. 2) you can specify to use
  414.     the big or small system font in a generic manner. The Big system font is the font
  415.     used in menus, etc. Chicago has filled that role for some time now. Small system
  416.     font is currently Geneva 10. The meta-font number implies the size and style.
  417.     
  418.     NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  419.                 the fore and back color (Static Text is the only one that does, for
  420.                 backwards compatibility). Also size, face, and addFontSize are ignored
  421.                 when using the meta-font numbering.
  422. */
  423. /*——————————————————————————————————————————————————————————————————————————————————————*/
  424.  
  425. enum {
  426.                                                                 /* Meta-font numbering - see not above */
  427.     kControlFontBigSystemFont    = -1,                            /* force to big system font*/
  428.     kControlFontSmallSystemFont    = -2,                            /* force to small system font*/
  429.     kControlFontSmallBoldSystemFont = -3                        /* force to small bold system font*/
  430. };
  431.  
  432. /* Add these masks together to set the flags field of a ControlFontStyleRec    */
  433. /* They specify which fields to apply to the text. It is important to make    */
  434. /* sure that you specify only the fields that you wish to set.                */
  435.  
  436. enum {
  437.     kControlUseFontMask            = 0x0001,
  438.     kControlUseFaceMask            = 0x0002,
  439.     kControlUseSizeMask            = 0x0004,
  440.     kControlUseForeColorMask    = 0x0008,
  441.     kControlUseBackColorMask    = 0x0010,
  442.     kControlUseModeMask            = 0x0020,
  443.     kControlUseJustMask            = 0x0040,
  444.     kControlUseAllMask            = 0x00FF,
  445.     kControlAddFontSizeMask        = 0x0100
  446. };
  447.  
  448. struct ControlFontStyleRec {
  449.     SInt16                             flags;
  450.     SInt16                             font;
  451.     SInt16                             size;
  452.     SInt16                             style;
  453.     SInt16                             mode;
  454.     SInt16                             just;
  455.     RGBColor                         foreColor;
  456.     RGBColor                         backColor;
  457. };
  458. typedef struct ControlFontStyleRec ControlFontStyleRec;
  459.  
  460. typedef ControlFontStyleRec *ControlFontStylePtr;
  461. /*——————————————————————————————————————————————————————————————————————————————————————*/
  462. /* Common data tags for Get/SetControlData                                                */
  463. /*——————————————————————————————————————————————————————————————————————————————————————*/
  464.  
  465. enum {
  466.     kControlFontStyleTag        = 'font',
  467.     kControlKeyFilterTag        = 'fltr'
  468. };
  469.  
  470. /*——————————————————————————————————————————————————————————————————————————————————————*/
  471. /* Errors are in the range -30580 .. -30599                                                */
  472. /*——————————————————————————————————————————————————————————————————————————————————————*/
  473.  
  474. enum {
  475.     errMessageNotSupported        = -30580,
  476.     errDataNotSupported            = -30581,
  477.     errControlDoesntSupportFocus = -30582,
  478.     errWindowDoesntSupportFocus    = -30583,
  479.     errUnknownControl            = -30584,
  480.     errCouldntSetFocus            = -30585,
  481.     errNoRootControl            = -30586,
  482.     errRootAlreadyExists        = -30587,
  483.     errInvalidPartCode            = -30588,
  484.     errControlsAlreadyExist        = -30589,
  485.     errControlIsNotEmbedder        = -30590,
  486.     errDataSizeMismatch            = -30591,
  487.     errControlHiddenOrDisabled    = -30592,
  488.     errWindowRegionCodeInvalid    = -30593,
  489.     errCantEmbedIntoSelf        = -30594,
  490.     errCantEmbedRoot            = -30595,
  491.     errItemNotControl            = -30596
  492. };
  493.  
  494.  
  495. enum {
  496.                                                                 /* Control feature bits - returned by GetControlFeatures */
  497.     kControlSupportsGhosting    = 1 << 0,
  498.     kControlSupportsEmbedding    = 1 << 1,
  499.     kControlSupportsFocus        = 1 << 2,
  500.     kControlWantsIdle            = 1 << 3,
  501.     kControlWantsActivate        = 1 << 4,
  502.     kControlHandlesTracking        = 1 << 5,
  503.     kControlSupportsDataAccess    = 1 << 6,
  504.     kControlHasSpecialBackground = 1 << 7,
  505.     kControlGetsFocusOnClick    = 1 << 8,
  506.     kControlSupportsCalcBestRect = 1 << 9,
  507.     kControlSupportsLiveFeedback = 1 << 10
  508. };
  509.  
  510.  
  511. enum {
  512.                                                                 /* Control Messages */
  513.     kControlMsgDrawGhost        = 13,
  514.     kControlMsgCalcBestRect        = 14,                            /* Calculate best fitting rectangle for control*/
  515.     kControlMsgHandleTracking    = 15,
  516.     kControlMsgFocus            = 16,                            /* param indicates action.*/
  517.     kControlMsgKeyDown            = 17,
  518.     kControlMsgIdle                = 18,
  519.     kControlMsgGetFeatures        = 19,
  520.     kControlMsgSetData            = 20,
  521.     kControlMsgGetData            = 21,
  522.     kControlMsgActivate            = 22,
  523.     kControlMsgSetUpBackground    = 23,
  524.     kControlMsgCalcValue        = 24,
  525.     kControlMsgSubControlHit    = 25,
  526.     kControlMsgCalcValueFromPos    = 26,
  527.     kControlMsgTestNewMsgSupport = 27                            /* See if this control supports new messaging*/
  528. };
  529.  
  530. /*——————————————————————————————————————————————————————————————————————————————————————*/
  531. /*     This structure is passed into a CDEF when called with the kControlMsgHandleTracking    */
  532. /*    message                                                                             */
  533. /*——————————————————————————————————————————————————————————————————————————————————————*/
  534. struct ControlTrackingRec {
  535.     Point                             startPt;
  536.     SInt16                             modifiers;
  537.     ControlActionUPP                 action;
  538. };
  539. typedef struct ControlTrackingRec ControlTrackingRec;
  540.  
  541. typedef ControlTrackingRec *ControlTrackingPtr;
  542. /*——————————————————————————————————————————————————————————————————————————————————————*/
  543. /* This structure is passed into a CDEF when called with the kControlMsgKeyDown message */
  544. /*——————————————————————————————————————————————————————————————————————————————————————*/
  545. struct ControlKeyDownRec {
  546.     SInt16                             modifiers;
  547.     SInt16                             keyCode;
  548.     SInt16                             charCode;
  549. };
  550. typedef struct ControlKeyDownRec ControlKeyDownRec;
  551.  
  552. typedef ControlKeyDownRec *ControlKeyDownPtr;
  553. /*——————————————————————————————————————————————————————————————————————————————————————*/
  554. /* This structure is passed into a CDEF when called with the kControlMsgGetData or        */
  555. /* kControlMsgSetData message                                                             */
  556. /*——————————————————————————————————————————————————————————————————————————————————————*/
  557. struct ControlDataAccessRec {
  558.     ResType                         tag;
  559.     ResType                         part;
  560.     Size                             size;
  561.     Ptr                             dataPtr;
  562. };
  563. typedef struct ControlDataAccessRec ControlDataAccessRec;
  564.  
  565. typedef ControlDataAccessRec *ControlDataAccessPtr;
  566. /*——————————————————————————————————————————————————————————————————————————————————————*/
  567. /* This structure is passed into a CDEF when called with the kControlCalcBestRect msg     */
  568. /*——————————————————————————————————————————————————————————————————————————————————————*/
  569. struct ControlCalcSizeRec {
  570.     SInt16                             height;
  571.     SInt16                             width;
  572.     SInt16                             baseLine;
  573. };
  574. typedef struct ControlCalcSizeRec ControlCalcSizeRec;
  575.  
  576. typedef ControlCalcSizeRec *ControlCalcSizePtr;
  577. /*——————————————————————————————————————————————————————————————————————————————————————*/
  578. /* This structure is passed into a CDEF when called with the kControlMsgSetUpBackground */
  579. /* message is sent                                                                        */
  580. /*——————————————————————————————————————————————————————————————————————————————————————*/
  581. struct ControlBackgroundRec {
  582.     SInt16                             depth;
  583.     Boolean                         colorDevice;
  584. };
  585. typedef struct ControlBackgroundRec ControlBackgroundRec;
  586.  
  587. typedef ControlBackgroundRec *ControlBackgroundPtr;
  588. /*——————————————————————————————————————————————————————————————————————————————————————*/
  589. /*    Key Filter                                                                            */
  590. /*                                                                                        */
  591. /* Definition of a key filter for intercepting and possibly changing keystrokes            */
  592. /* which are destined for a control                                                        */
  593. /*——————————————————————————————————————————————————————————————————————————————————————*/
  594. typedef pascal ControlKeyFilterResult (*ControlKeyFilterProcPtr)(ControlHandle theControl, SInt16 *keyCode, SInt16 *charCode, SInt16 *modifiers);
  595.  
  596. #if GENERATINGCFM
  597. typedef UniversalProcPtr ControlKeyFilterUPP;
  598. #else
  599. typedef ControlKeyFilterProcPtr ControlKeyFilterUPP;
  600. #endif
  601.  
  602. enum {
  603.     uppControlKeyFilterProcInfo = kPascalStackBased
  604.          | RESULT_SIZE(SIZE_CODE(sizeof(ControlKeyFilterResult)))
  605.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  606.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(SInt16 *)))
  607.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(SInt16 *)))
  608.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SInt16 *)))
  609. };
  610.  
  611. #if GENERATINGCFM
  612. #define NewControlKeyFilterProc(userRoutine)        \
  613.         (ControlKeyFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlKeyFilterProcInfo, GetCurrentArchitecture())
  614. #else
  615. #define NewControlKeyFilterProc(userRoutine)        \
  616.         ((ControlKeyFilterUPP) (userRoutine))
  617. #endif
  618.  
  619. #if GENERATINGCFM
  620. #define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers)        \
  621.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlKeyFilterProcInfo, (theControl), (keyCode), (charCode), (modifiers))
  622. #else
  623. #define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers)        \
  624.         (*(userRoutine))((theControl), (keyCode), (charCode), (modifiers))
  625. #endif
  626. /*——————————————————————————————————————————————————————————————————————————————————————*/
  627. /*    • BEVEL BUTTON INTERFACE (CDEF 2)                                                    */
  628. /*——————————————————————————————————————————————————————————————————————————————————————*/
  629. /*    Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    */
  630. /* (pushbutton/toggle/sticky), and the bevel size. You also have the option of            */
  631. /*    attaching a menu to it. When a menu is present, you can specify which way the         */
  632. /*    popup arrow is facing (down or right).                                                */
  633. /*                                                                                        */
  634. /*    This is all made possible by overloading the Min, Max, and Value parameters for the    */
  635. /*    control, as well as adjusting the variant. Here's the breakdown of what goes where:    */
  636. /*                                                                                        */
  637. /*    Parameter                    What Goes Here                                            */
  638. /*    ———————————————————            ————————————————————————————————————————————————————    */
  639. /*    Min                            Hi Byte = Behavior, Lo Byte = content type.                */
  640. /*    Max                            ResID for resource-based content types.                    */
  641. /*    Value                        MenuID to attach, 0 = no menu, please.                    */
  642. /*                                                                                        */
  643. /*    The variant is broken down into two halfs. The low 2 bits control the bevel type.    */
  644. /*    Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    */
  645. /*    whether or not to use the control's owning window's font.                            */
  646. /*                                                                                        */
  647. /*    Constants for all you need to put this together are below. The values for behaviors    */
  648. /*    are set up so that you can simply add them to the content type and pass them into    */
  649. /*    the Min parameter of NewControl.                                                    */
  650. /*                                                                                        */
  651. /*    An example call:                                                                    */
  652. /*                                                                                        */
  653. /*    control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         */
  654. /*                            kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    */
  655. /*                            0L );                                                        */
  656. /*                                                                                        */
  657. /*    Attaching a menu:                                                                    */
  658. /*                                                                                        */
  659. /*    control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    */
  660. /*            myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    */
  661. /*                                                                                        */
  662. /*    This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.*/
  663. /*    This also puts the menu up to the right of the button. You can also specify that a    */
  664. /*    menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        */
  665. /*    into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    */
  666. /*    helper function will return the last item chosen from the menu, whether or not it    */
  667. /*    was checked.                                                                        */
  668. /*                                                                                        */
  669. /*    NOTE:     Bevel buttons with menus actually have *two* values. The value of the         */
  670. /*            button (on/off), and the value of the menu. The menu value can be gotten    */
  671. /*            with the GetBevelButtonMenuValue helper function.                            */
  672. /*                                                                                        */
  673. /*    Handle-based Content                                                                */
  674. /*    ————————————————————                                                                */
  675. /*    You can create your control and then set the content to an existing handle to an    */
  676. /*    icon suite, etc. using the macros below. Please keep in mind that resource-based    */
  677. /*    content is owned by the control, handle-based content is owned by you. The CDEF will*/
  678. /*    not try to dispose of handle-based content. If you are changing the content type of    */
  679. /*    the button on the fly, you must make sure that if you are replacing a handle-        */
  680. /*    based content with a resource-based content to properly dispose of the handle,        */
  681. /*    else a memory leak will ensue.                                                        */
  682. /*                                                                                        */
  683.  
  684. enum {
  685.                                                                 /* Bevel Button Proc IDs */
  686.     kControlBevelButtonSmallBevelProc = 32,
  687.     kControlBevelButtonNormalBevelProc = 33,
  688.     kControlBevelButtonLargeBevelProc = 34
  689. };
  690.  
  691.  
  692. enum {
  693.                                                                 /* Bevel button graphic alignment values */
  694.     kControlBevelButtonAlignSysDirection = -1,                    /* only left or right*/
  695.     kControlBevelButtonAlignCenter = 0,
  696.     kControlBevelButtonAlignLeft = 1,
  697.     kControlBevelButtonAlignRight = 2,
  698.     kControlBevelButtonAlignTop    = 3,
  699.     kControlBevelButtonAlignBottom = 4,
  700.     kControlBevelButtonAlignTopLeft = 5,
  701.     kControlBevelButtonAlignBottomLeft = 6,
  702.     kControlBevelButtonAlignTopRight = 7,
  703.     kControlBevelButtonAlignBottomRight = 8
  704. };
  705.  
  706. typedef SInt16 ControlButtonGraphicAlignment;
  707.  
  708. enum {
  709.                                                                 /* Bevel button text alignment values */
  710.     kControlBevelButtonAlignTextSysDirection = teFlushDefault,
  711.     kControlBevelButtonAlignTextCenter = teCenter,
  712.     kControlBevelButtonAlignTextFlushRight = teFlushRight,
  713.     kControlBevelButtonAlignTextFlushLeft = teFlushLeft
  714. };
  715.  
  716. typedef SInt16 ControlButtonTextAlignment;
  717.  
  718. enum {
  719.                                                                 /* Bevel button text placement values */
  720.     kControlBevelButtonPlaceSysDirection = -1,                    /* if graphic on right, then on left*/
  721.     kControlBevelButtonPlaceNormally = 0,
  722.     kControlBevelButtonPlaceToRightOfGraphic = 1,
  723.     kControlBevelButtonPlaceToLeftOfGraphic = 2,
  724.     kControlBevelButtonPlaceBelowGraphic = 3,
  725.     kControlBevelButtonPlaceAboveGraphic = 4
  726. };
  727.  
  728. typedef SInt16 ControlButtonTextPlacement;
  729. /* Add these variant codes to kBevelButtonSmallBevelProc to change the type of button */
  730.  
  731. enum {
  732.     kControlBevelButtonSmallBevelVariant = 0,
  733.     kControlBevelButtonNormalBevelVariant = (1 << 0),
  734.     kControlBevelButtonLargeBevelVariant = (1 << 1),
  735.     kControlBevelButtonMenuOnRight = (1 << 2)
  736. };
  737.  
  738. /*
  739.  Behaviors of bevel buttons. These are set up so you can add
  740.  them together with the content types.
  741. */
  742.  
  743. enum {
  744.     kControlBehaviorPushbutton    = 0,
  745.     kControlBehaviorToggles        = 0x0100,
  746.     kControlBehaviorSticky        = 0x0200,
  747.     kControlBehaviorMultiValueMenu = 0x4000,                    /* only makes sense when a menu is attached.*/
  748.     kControlBehaviorOffsetContents = 0x8000
  749. };
  750.  
  751. /* Content types supported by bevel buttons *and* image wells*/
  752.  
  753. enum {
  754.     kControlContentTextOnly        = 0,
  755.     kControlContentIconSuiteRes    = 1,
  756.     kControlContentCIconRes        = 2,
  757.     kControlContentPictRes        = 3,
  758.     kControlContentIconSuiteHandle = 129,
  759.     kControlContentCIconHandle    = 130,
  760.     kControlContentPictHandle    = 131,
  761.     kControlContentIconRef        = 132
  762. };
  763.  
  764. typedef SInt16 ControlContentType;
  765. /* Data tags supported by the bevel button controls */
  766.  
  767. enum {
  768.     kControlBevelButtonContentTag = 'cont',                        /* ButtonContentInfo*/
  769.     kControlBevelButtonTransformTag = 'tran',                    /* IconTransformType*/
  770.     kControlBevelButtonTextAlignTag = 'tali',                    /* ButtonTextAlignment*/
  771.     kControlBevelButtonTextOffsetTag = 'toff',                    /* SInt16*/
  772.     kControlBevelButtonGraphicAlignTag = 'gali',                /* ButtonGraphicAlignment*/
  773.     kControlBevelButtonGraphicOffsetTag = 'goff',                /* Point*/
  774.     kControlBevelButtonTextPlaceTag = 'tplc',                    /* ButtonTextPlacement*/
  775.     kControlBevelButtonMenuValueTag = 'mval',                    /* SInt16*/
  776.     kControlBevelButtonMenuHandleTag = 'mhnd'                    /* MenuHandle*/
  777. };
  778.  
  779. /* Structure to pass into bevel buttons and image wells to set/get content type */
  780. struct ControlButtonContentInfo {
  781.     ControlContentType                 contentType;
  782.     union {
  783.         SInt16                             resID;
  784.         CIconHandle                     cIconHandle;
  785.         Handle                             iconSuite;
  786.         Handle                             iconRef;
  787.         PicHandle                         picture;
  788.     }                                 u;
  789. };
  790. typedef struct ControlButtonContentInfo ControlButtonContentInfo;
  791.  
  792. typedef ControlButtonContentInfo *ControlButtonContentInfoPtr;
  793. /*——————————————————————————————————————————————————————————————————————————————————————*/
  794. /*    • SLIDER (CDEF 3)                                                                    */
  795. /*——————————————————————————————————————————————————————————————————————————————————————*/
  796. /*    There are several variants that control the behavior of the slider control. Any        */
  797. /*    combination of the following three constants can be added to the basic CDEF ID        */
  798. /*    (kSliderProc).                                                                        */
  799. /*                                                                                        */
  800. /*    Variants:                                                                            */
  801. /*                                                                                        */
  802. /*        kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    */
  803. /*                                ActionProc is called (set via SetControlAction) as the    */
  804. /*                                indicator is dragged. The value is updated so that the    */
  805. /*                                actionproc can adjust some other property based on the    */
  806. /*                                value each time the action proc is called. If no action    */
  807. /*                                proc is installed, it reverts to the ghost indicator.    */
  808. /*                                                                                        */
  809. /*        kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            */
  810. /*                                rectangle must be large enough to accomidate the tick    */
  811. /*                                marks.                                                    */
  812. /*|*        kSliderReverseDirection    Slider thumb points in opposite direction than normal.    */
  813. /*                                If the slider is vertical, the thumb will point to the    */
  814. /*                                left, if the slider is horizontal, the thumb will point    */
  815. /*                                upwards.                                                */
  816. /*                                                                                        */
  817. /*        kSliderNonDirectional    This option overrides the kSliderReverseDirection and    */
  818. /*                                kSliderHasTickMarks variants. It creates an indicator    */
  819. /*                                which is rectangular and doesn't point in any direction    */
  820. /*                                like the normal indicator does.                            */
  821.  
  822. enum {
  823.                                                                 /* Slider proc IDs */
  824.     kControlSliderProc            = 48,
  825.     kControlSliderLiveFeedback    = (1 << 0),
  826.     kControlSliderHasTickMarks    = (1 << 1),
  827.     kControlSliderReverseDirection = (1 << 2),
  828.     kControlSliderNonDirectional = (1 << 3)
  829. };
  830.  
  831. /*——————————————————————————————————————————————————————————————————————————————————————*/
  832. /*    • DISCLOSURE TRIANGLE (CDEF 4)                                                        */
  833. /*——————————————————————————————————————————————————————————————————————————————————————*/
  834. /*    This control can be used as either left or right facing. It can also handle its own    */
  835. /*    tracking if you wish. This means that when the 'autotoggle' variant is used, if the    */
  836. /*    user clicks the control, it's state will change automatically from open to closed    */
  837. /*    and vice-versa depending on its initial state. After a successful call to Track-    */
  838. /*     Control, you can just check the current value to see what state it was switched to.    */
  839.  
  840. enum {
  841.                                                                 /* Triangle proc IDs */
  842.     kControlTriangleProc        = 64,
  843.     kControlTriangleLeftFacingProc = 65,
  844.     kControlTriangleAutoToggleProc = 66,
  845.     kControlTriangleLeftFacingAutoToggleProc = 67
  846. };
  847.  
  848.  
  849. enum {
  850.                                                                 /* Tagged data supported by disclosure triangles */
  851.     kControlTriangleLastValueTag = 'last'                        /* SInt16*/
  852. };
  853.  
  854. /*——————————————————————————————————————————————————————————————————————————————————————*/
  855. /*    • PROGRESS INDICATOR (CDEF 5)                                                        */
  856. /*——————————————————————————————————————————————————————————————————————————————————————*/
  857. /*    This CDEF implements both determinate and indeterminate progress bars. To switch,     */
  858. /*    just use SetControlData to set the indeterminate flag to make it indeterminate call    */
  859. /*    IdleControls to step thru the animation. IdleControls should be called at least        */
  860. /*    once during your event loop.                                                        */
  861. /*                                                                                        */
  862.  
  863. enum {
  864.                                                                 /* Progress Bar proc IDs */
  865.     kControlProgressBarProc        = 80
  866. };
  867.  
  868.  
  869. enum {
  870.                                                                 /* Tagged data supported by progress bars */
  871.     kControlProgressBarIndeterminateTag = 'inde'                /* Boolean*/
  872. };
  873.  
  874. /*——————————————————————————————————————————————————————————————————————————————————————*/
  875. /*    • LITTLE ARROWS (CDEF 6)                                                            */
  876. /*——————————————————————————————————————————————————————————————————————————————————————*/
  877. /*     This control implements the little up and down arrows you'd see in the Memory        */
  878. /*    control panel for adjusting the cache size.                                         */
  879.  
  880. enum {
  881.                                                                 /* Little Arrows proc IDs */
  882.     kControlLittleArrowsProc    = 96
  883. };
  884.  
  885. /*——————————————————————————————————————————————————————————————————————————————————————*/
  886. /*    • CHASING ARROWS (CDEF 7)                                                            */
  887. /*——————————————————————————————————————————————————————————————————————————————————————*/
  888. /*    To animate this control, make sure to call IdleControls repeatedly.                    */
  889. /*                                                                                        */
  890.  
  891. enum {
  892.                                                                 /* Chasing Arrows proc IDs */
  893.     kControlChasingArrowsProc    = 112
  894. };
  895.  
  896. /*——————————————————————————————————————————————————————————————————————————————————————*/
  897. /*    • TABS (CDEF 8)                                                                        */
  898. /*——————————————————————————————————————————————————————————————————————————————————————*/
  899. /*    Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    */
  900. /*    and an icon suite ID for each tab.                                                    */
  901. /*                                                                                        */
  902. /*    The ID of the tab# resource that you wish to associate with a tab control should     */
  903. /*    be passed in as the Value parameter of the control. If you are using GetNewControl, */
  904. /*    then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    */
  905. /*    on creation.                                                                        */
  906. /*                                                                                        */
  907.  
  908. enum {
  909.                                                                 /* Tabs proc IDs */
  910.     kControlTabLargeProc        = 128,                            /* Large tab size    */
  911.     kControlTabSmallProc        = 129                            /* Small tab size    */
  912. };
  913.  
  914.  
  915. enum {
  916.                                                                 /* Tagged data supported by progress bars */
  917.     kControlTabContentRectTag    = 'rect',                        /* Rect*/
  918.     kControlTabEnabledFlagTag    = 'enab',                        /* Boolean*/
  919.     kControlTabFontStyleTag        = kControlFontStyleTag            /* ControlFontStyleRec*/
  920. };
  921.  
  922. /*——————————————————————————————————————————————————————————————————————————————————————*/
  923. /*    • VISUAL SEPARATOR (CDEF 9)                                                            */
  924. /*——————————————————————————————————————————————————————————————————————————————————————*/
  925. /*    Separator lines determine their orientation (horizontal or vertical) automatically    */
  926. /*    based on the relative height and width of their contrlRect.                            */
  927.  
  928. enum {
  929.                                                                 /* Visual separator proc IDs */
  930.     kControlSeparatorLineProc    = 144
  931. };
  932.  
  933. /*——————————————————————————————————————————————————————————————————————————————————————*/
  934. /*    • GROUP BOX (CDEF 10)                                                                */
  935. /*——————————————————————————————————————————————————————————————————————————————————————*/
  936. /*    The group box CDEF can be use in several ways. It can have no title, a text title,     */
  937. /*    a check box as the title, or a popup button as a title. There are two versions of     */
  938. /*    group boxes, primary and secondary, which look slightly different.                    */
  939.  
  940. enum {
  941.                                                                 /* Group Box proc IDs */
  942.     kControlGroupBoxTextTitleProc = 160,
  943.     kControlGroupBoxCheckBoxProc = 161,
  944.     kControlGroupBoxPopupButtonProc = 162,
  945.     kControlGroupBoxSecondaryTextTitleProc = 164,
  946.     kControlGroupBoxSecondaryCheckBoxProc = 165,
  947.     kControlGroupBoxSecondaryPopupButtonProc = 166
  948. };
  949.  
  950.  
  951. enum {
  952.                                                                 /* Tagged data supported by group box */
  953.     kControlGroupBoxMenuHandleTag = 'mhan',                        /* MenuHandle (popup title only)*/
  954.     kControlGroupBoxFontStyleTag = kControlFontStyleTag            /* ControlFontStyleRec*/
  955. };
  956.  
  957. /*——————————————————————————————————————————————————————————————————————————————————————*/
  958. /*    • IMAGE WELL (CDEF 11)                                                                */
  959. /*——————————————————————————————————————————————————————————————————————————————————————*/
  960. /*    Image Wells allow you to control the content type (pict/icon/etc.) shown in the     */
  961. /*    well.                                                                                */
  962. /*                                                                                        */
  963. /*    This is made possible by overloading the Min and Value parameters for the control.    */
  964. /*                                                                                        */
  965. /*    Parameter                    What Goes Here                                            */
  966. /*    ———————————————————            ——————————————————————————————————————————————————        */
  967. /*    Min                            content type (see constants for bevel buttons)            */
  968. /*    Value                        Resource ID of content type, if resource-based.            */
  969. /*                                                                                        */
  970. /*                                                                                        */
  971. /*    Checked State                                                                        */
  972. /*    —————————————                                                                        */
  973. /*    The checked state is enabled by setting the value of the control to 1, just like a     */
  974. /*    check box.                                                                            */
  975. /*                                                                                        */
  976. /*    Handle-based Content                                                                */
  977. /*    ————————————————————                                                                */
  978. /*    You can create your control and then set the content to an existing handle to an    */
  979. /*    icon suite, etc. using the macros below. Please keep in mind that resource-based    */
  980. /*    content is owned by the control, handle-based content is owned by you. The CDEF will*/
  981. /*    not try to dispose of handle-based content. If you are changing the content type of    */
  982. /*    the button on the fly, you must make sure that if you are replacing a handle-        */
  983. /*    based content with a resource-based content to properly dispose of the handle,        */
  984. /*    else a memory leak will ensue.                                                        */
  985. /*                                                                                        */
  986. /*                                                                                        */
  987. /*    AutoTracking                                                                        */
  988. /*    ————————————                                                                        */
  989. /*    Image Wells are capable of autotracking. The current autotracking feature sets the     */
  990. /*    value itself, so that the control remains hilited. It behaves as a sort of palette     */
  991. /*    type object where clicking selects it, it cannot be delected by clicking it again,     */
  992. /*    clicking on another object should cause the focus to change (as in Get Info windows)*/
  993. /*    and the application should then set the value to 0 to take away the checked border.    */
  994. /*                                                                                        */
  995.  
  996. enum {
  997.                                                                 /* Image Well proc IDs */
  998.     kControlImageWellProc        = 176,
  999.     kControlImageWellAutoTrackProc = 177
  1000. };
  1001.  
  1002.  
  1003. enum {
  1004.                                                                 /* Tagged data supported by image wells */
  1005.     kControlImageWellContentTag    = 'cont',                        /* ButtonContentInfo*/
  1006.     kControlImageWellTransformTag = 'tran'                        /* IconTransformType*/
  1007. };
  1008.  
  1009. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1010. /*    • POPUP ARROW (CDEF 12)                                                                */
  1011. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1012. /*    The popup arrow CDEF is used to draw the small arrow normally associated with a     */
  1013. /*    popup control. The arrow can point in four directions, and a small or large version */
  1014. /*    can be used. This control is provided to allow clients to draw the arrow in a         */
  1015. /*    normalized fashion which will take advantage of themes automatically.                */
  1016. /*                                                                                        */
  1017.  
  1018. enum {
  1019.                                                                 /* Popup Arrow proc IDs */
  1020.     kControlPopupArrowEastProc    = 192,
  1021.     kControlPopupArrowWestProc    = 193,
  1022.     kControlPopupArrowNorthProc    = 194,
  1023.     kControlPopupArrowSouthProc    = 195,
  1024.     kControlPopupArrowSmallEastProc = 196,
  1025.     kControlPopupArrowSmallWestProc = 197,
  1026.     kControlPopupArrowSmallNorthProc = 198,
  1027.     kControlPopupArrowSmallSouthProc = 199
  1028. };
  1029.  
  1030. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1031. /*    • PLACARD (CDEF 14)                                                                    */
  1032. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1033.  
  1034. enum {
  1035.                                                                 /* Placard proc IDs */
  1036.     kControlPlacardProc            = 224
  1037. };
  1038.  
  1039. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1040. /*    • CLOCK (CDEF 15)                                                                    */
  1041. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1042. /*     NOTE:    You can specify more options in the Value paramter when creating the clock.    */
  1043. /*            See below.                                                                    */
  1044.  
  1045. enum {
  1046.                                                                 /* Clock proc IDs */
  1047.     kControlClockTimeProc        = 240,
  1048.     kControlClockTimeSecondsProc = 241,
  1049.     kControlClockDateProc        = 242,
  1050.     kControlClockMonthYearProc    = 243
  1051. };
  1052.  
  1053. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1054. /*     These flags can be passed into 'value' field on creation of the control.            */
  1055. /*     Value is set to 0 after control is created.                                            */
  1056. /*                                                                                        */
  1057. /*    The kClockIsLive value tells the clock to automatically update on idle (clock will    */
  1058. /*    have the current time). This flag is only valid when the kClockIsDisplayOnly flag    */
  1059. /*    is set.                                                                                */
  1060. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1061.  
  1062. enum {
  1063.     kControlClockNoFlags        = 0,
  1064.     kControlClockIsDisplayOnly    = 1,
  1065.     kControlClockIsLive            = 2
  1066. };
  1067.  
  1068.  
  1069. enum {
  1070.                                                                 /* Tagged data supported by clocks */
  1071.     kControlClockLongDateTag    = 'date',                        /* LongDateRec*/
  1072.     kControlClockFontStyleTag    = kControlFontStyleTag            /* ControlFontStyleRec*/
  1073. };
  1074.  
  1075. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1076. /*    • USER PANE (CDEF 16)                                                                */
  1077. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1078.  
  1079. enum {
  1080.                                                                 /* User Pane proc IDs */
  1081.     kControlUserPaneProc        = 256
  1082. };
  1083.  
  1084. /* Tagged data supported by user panes */
  1085. /* Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. */
  1086.  
  1087. enum {
  1088.     kControlUserItemDrawProcTag    = 'uidp',                        /* UserItemUPP*/
  1089.     kControlUserPaneDrawProcTag    = 'draw',                        /* ControlUserPaneDrawingUPP*/
  1090.     kControlUserPaneHitTestProcTag = 'hitt',                    /* ControlUserPaneHitTestUPP*/
  1091.     kControlUserPaneTrackingProcTag = 'trak',                    /* ControlUserPaneTrackingUPP*/
  1092.     kControlUserPaneIdleProcTag    = 'idle',                        /* ControlUserPaneIdleUPP*/
  1093.     kControlUserPaneKeyDownProcTag = 'keyd',                    /* ControlUserPaneKeyDownUPP*/
  1094.     kControlUserPaneActivateProcTag = 'acti',                    /* ControlUserPaneActivateUPP*/
  1095.     kControlUserPaneFocusProcTag = 'foci',                        /* ControlUserPaneFocusUPP*/
  1096.     kControlUserPaneBackgroundProcTag = 'back'                    /* ControlUserPaneBackgroundUPP*/
  1097. };
  1098.  
  1099. typedef pascal void (*ControlUserPaneDrawProcPtr)(ControlHandle control, SInt16 part);
  1100. typedef pascal ControlPartCode (*ControlUserPaneHitTestProcPtr)(ControlHandle control, Point where);
  1101. typedef pascal ControlPartCode (*ControlUserPaneTrackingProcPtr)(ControlHandle control, Point startPt, ControlActionUPP actionProc);
  1102. typedef pascal void (*ControlUserPaneIdleProcPtr)(ControlHandle control);
  1103. typedef pascal ControlPartCode (*ControlUserPaneKeyDownProcPtr)(ControlHandle control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers);
  1104. typedef pascal void (*ControlUserPaneActivateProcPtr)(ControlHandle control, Boolean activating);
  1105. typedef pascal ControlPartCode (*ControlUserPaneFocusProcPtr)(ControlHandle control, ControlFocusPart action);
  1106. typedef pascal void (*ControlUserPaneBackgroundProcPtr)(ControlHandle control, ControlBackgroundPtr info);
  1107.  
  1108. #if GENERATINGCFM
  1109. typedef UniversalProcPtr ControlUserPaneDrawUPP;
  1110. typedef UniversalProcPtr ControlUserPaneHitTestUPP;
  1111. typedef UniversalProcPtr ControlUserPaneTrackingUPP;
  1112. typedef UniversalProcPtr ControlUserPaneIdleUPP;
  1113. typedef UniversalProcPtr ControlUserPaneKeyDownUPP;
  1114. typedef UniversalProcPtr ControlUserPaneActivateUPP;
  1115. typedef UniversalProcPtr ControlUserPaneFocusUPP;
  1116. typedef UniversalProcPtr ControlUserPaneBackgroundUPP;
  1117. #else
  1118. typedef ControlUserPaneDrawProcPtr ControlUserPaneDrawUPP;
  1119. typedef ControlUserPaneHitTestProcPtr ControlUserPaneHitTestUPP;
  1120. typedef ControlUserPaneTrackingProcPtr ControlUserPaneTrackingUPP;
  1121. typedef ControlUserPaneIdleProcPtr ControlUserPaneIdleUPP;
  1122. typedef ControlUserPaneKeyDownProcPtr ControlUserPaneKeyDownUPP;
  1123. typedef ControlUserPaneActivateProcPtr ControlUserPaneActivateUPP;
  1124. typedef ControlUserPaneFocusProcPtr ControlUserPaneFocusUPP;
  1125. typedef ControlUserPaneBackgroundProcPtr ControlUserPaneBackgroundUPP;
  1126. #endif
  1127.  
  1128. enum {
  1129.     uppControlUserPaneDrawProcInfo = kPascalStackBased
  1130.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1131.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(SInt16))),
  1132.     uppControlUserPaneHitTestProcInfo = kPascalStackBased
  1133.          | RESULT_SIZE(SIZE_CODE(sizeof(ControlPartCode)))
  1134.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1135.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Point))),
  1136.     uppControlUserPaneTrackingProcInfo = kPascalStackBased
  1137.          | RESULT_SIZE(SIZE_CODE(sizeof(ControlPartCode)))
  1138.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1139.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Point)))
  1140.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ControlActionUPP))),
  1141.     uppControlUserPaneIdleProcInfo = kPascalStackBased
  1142.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle))),
  1143.     uppControlUserPaneKeyDownProcInfo = kPascalStackBased
  1144.          | RESULT_SIZE(SIZE_CODE(sizeof(ControlPartCode)))
  1145.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1146.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(SInt16)))
  1147.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(SInt16)))
  1148.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SInt16))),
  1149.     uppControlUserPaneActivateProcInfo = kPascalStackBased
  1150.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1151.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean))),
  1152.     uppControlUserPaneFocusProcInfo = kPascalStackBased
  1153.          | RESULT_SIZE(SIZE_CODE(sizeof(ControlPartCode)))
  1154.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1155.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlFocusPart))),
  1156.     uppControlUserPaneBackgroundProcInfo = kPascalStackBased
  1157.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  1158.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlBackgroundPtr)))
  1159. };
  1160.  
  1161. #if GENERATINGCFM
  1162. #define NewControlUserPaneDrawProc(userRoutine)        \
  1163.         (ControlUserPaneDrawUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneDrawProcInfo, GetCurrentArchitecture())
  1164. #define NewControlUserPaneHitTestProc(userRoutine)        \
  1165.         (ControlUserPaneHitTestUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneHitTestProcInfo, GetCurrentArchitecture())
  1166. #define NewControlUserPaneTrackingProc(userRoutine)        \
  1167.         (ControlUserPaneTrackingUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneTrackingProcInfo, GetCurrentArchitecture())
  1168. #define NewControlUserPaneIdleProc(userRoutine)        \
  1169.         (ControlUserPaneIdleUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneIdleProcInfo, GetCurrentArchitecture())
  1170. #define NewControlUserPaneKeyDownProc(userRoutine)        \
  1171.         (ControlUserPaneKeyDownUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneKeyDownProcInfo, GetCurrentArchitecture())
  1172. #define NewControlUserPaneActivateProc(userRoutine)        \
  1173.         (ControlUserPaneActivateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneActivateProcInfo, GetCurrentArchitecture())
  1174. #define NewControlUserPaneFocusProc(userRoutine)        \
  1175.         (ControlUserPaneFocusUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneFocusProcInfo, GetCurrentArchitecture())
  1176. #define NewControlUserPaneBackgroundProc(userRoutine)        \
  1177.         (ControlUserPaneBackgroundUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneBackgroundProcInfo, GetCurrentArchitecture())
  1178. #else
  1179. #define NewControlUserPaneDrawProc(userRoutine)        \
  1180.         ((ControlUserPaneDrawUPP) (userRoutine))
  1181. #define NewControlUserPaneHitTestProc(userRoutine)        \
  1182.         ((ControlUserPaneHitTestUPP) (userRoutine))
  1183. #define NewControlUserPaneTrackingProc(userRoutine)        \
  1184.         ((ControlUserPaneTrackingUPP) (userRoutine))
  1185. #define NewControlUserPaneIdleProc(userRoutine)        \
  1186.         ((ControlUserPaneIdleUPP) (userRoutine))
  1187. #define NewControlUserPaneKeyDownProc(userRoutine)        \
  1188.         ((ControlUserPaneKeyDownUPP) (userRoutine))
  1189. #define NewControlUserPaneActivateProc(userRoutine)        \
  1190.         ((ControlUserPaneActivateUPP) (userRoutine))
  1191. #define NewControlUserPaneFocusProc(userRoutine)        \
  1192.         ((ControlUserPaneFocusUPP) (userRoutine))
  1193. #define NewControlUserPaneBackgroundProc(userRoutine)        \
  1194.         ((ControlUserPaneBackgroundUPP) (userRoutine))
  1195. #endif
  1196.  
  1197. #if GENERATINGCFM
  1198. #define CallControlUserPaneDrawProc(userRoutine, control, part)        \
  1199.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneDrawProcInfo, (control), (part))
  1200. #define CallControlUserPaneHitTestProc(userRoutine, control, where)        \
  1201.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneHitTestProcInfo, (control), (where))
  1202. #define CallControlUserPaneTrackingProc(userRoutine, control, startPt, actionProc)        \
  1203.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneTrackingProcInfo, (control), (startPt), (actionProc))
  1204. #define CallControlUserPaneIdleProc(userRoutine, control)        \
  1205.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneIdleProcInfo, (control))
  1206. #define CallControlUserPaneKeyDownProc(userRoutine, control, keyCode, charCode, modifiers)        \
  1207.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneKeyDownProcInfo, (control), (keyCode), (charCode), (modifiers))
  1208. #define CallControlUserPaneActivateProc(userRoutine, control, activating)        \
  1209.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneActivateProcInfo, (control), (activating))
  1210. #define CallControlUserPaneFocusProc(userRoutine, control, action)        \
  1211.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneFocusProcInfo, (control), (action))
  1212. #define CallControlUserPaneBackgroundProc(userRoutine, control, info)        \
  1213.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlUserPaneBackgroundProcInfo, (control), (info))
  1214. #else
  1215. #define CallControlUserPaneDrawProc(userRoutine, control, part)        \
  1216.         (*(userRoutine))((control), (part))
  1217. #define CallControlUserPaneHitTestProc(userRoutine, control, where)        \
  1218.         (*(userRoutine))((control), (where))
  1219. #define CallControlUserPaneTrackingProc(userRoutine, control, startPt, actionProc)        \
  1220.         (*(userRoutine))((control), (startPt), (actionProc))
  1221. #define CallControlUserPaneIdleProc(userRoutine, control)        \
  1222.         (*(userRoutine))((control))
  1223. #define CallControlUserPaneKeyDownProc(userRoutine, control, keyCode, charCode, modifiers)        \
  1224.         (*(userRoutine))((control), (keyCode), (charCode), (modifiers))
  1225. #define CallControlUserPaneActivateProc(userRoutine, control, activating)        \
  1226.         (*(userRoutine))((control), (activating))
  1227. #define CallControlUserPaneFocusProc(userRoutine, control, action)        \
  1228.         (*(userRoutine))((control), (action))
  1229. #define CallControlUserPaneBackgroundProc(userRoutine, control, info)        \
  1230.         (*(userRoutine))((control), (info))
  1231. #endif
  1232. /*
  1233. ——————————————————————————————————————————————————————————————————————————————————————————
  1234.     • EDIT TEXT (CDEF 17)
  1235. ——————————————————————————————————————————————————————————————————————————————————————————
  1236. */
  1237.  
  1238. enum {
  1239.                                                                 /* Edit Text proc IDs */
  1240.     kControlEditTextProc        = 272,
  1241.     kControlEditTextDialogProc    = 273,
  1242.     kControlEditTextPasswordProc = 274
  1243. };
  1244.  
  1245.  
  1246. enum {
  1247.                                                                 /* Tagged data supported by edit text */
  1248.     kControlEditTextStyleTag    = kControlFontStyleTag,            /* ControlFontStyleRec*/
  1249.     kControlEditTextTextTag        = 'text',                        /* Buffer of chars - you supply the buffer*/
  1250.     kControlEditTextTEHandleTag    = 'than',                        /* The TEHandle of the text edit record*/
  1251.     kControlEditTextKeyFilterTag = kControlKeyFilterTag,
  1252.     kControlEditTextSelectionTag = 'sele',                        /* EditTextSelectionRec*/
  1253.     kControlEditTextPasswordTag    = 'pass'                        /* The clear text password text*/
  1254. };
  1255.  
  1256. struct ControlEditTextSelectionRec {
  1257.                                                                 /* Structure for getting the edit text selection */
  1258.     SInt16                             selStart;
  1259.     SInt16                             selEnd;
  1260. };
  1261. typedef struct ControlEditTextSelectionRec ControlEditTextSelectionRec;
  1262.  
  1263. typedef ControlEditTextSelectionRec *ControlEditTextSelectionPtr;
  1264. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1265. /*    • STATIC TEXT (CDEF 18)                                                                */
  1266. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1267. /* Static Text proc IDs */
  1268.  
  1269. enum {
  1270.     kControlStaticTextProc        = 288
  1271. };
  1272.  
  1273. /* Tagged data supported by static text */
  1274.  
  1275. enum {
  1276.     kControlStaticTextStyleTag    = kControlFontStyleTag,            /* ControlFontStyleRec*/
  1277.     kControlStaticTextTextTag    = 'text',                        /* Copy of text*/
  1278.     kControlStaticTextTextHeightTag = 'thei'                    /* SInt16*/
  1279. };
  1280.  
  1281. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1282. /*    • PICTURE CONTROL (CDEF 19)                                                            */
  1283. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1284. /*    Value parameter should contain the ID of the picture you wish to display when        */
  1285. /*    creating controls of this type. If you don't want the control tracked at all, use     */
  1286. /*    the 'no track' variant.                                                                */
  1287.  
  1288. enum {
  1289.                                                                 /* Picture control proc IDs */
  1290.     kControlPictureProc            = 304,
  1291.     kControlPictureNoTrackProc    = 305                            /* immediately returns kControlPicturePart*/
  1292. };
  1293.  
  1294. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1295. /*    • ICON CONTROL (CDEF 20)                                                            */
  1296. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1297. /*    Value parameter should contain the ID of the ICON or cicn you wish to display when    */
  1298. /*    creating controls of this type. If you don't want the control tracked at all, use     */
  1299. /*    the 'no track' variant.                                                                */
  1300. /* Icon control proc IDs */
  1301.  
  1302. enum {
  1303.     kControlIconProc            = 320,
  1304.     kControlIconNoTrackProc        = 321,                            /* immediately returns kControlIconPart*/
  1305.     kControlIconSuiteProc        = 322,
  1306.     kControlIconSuiteNoTrackProc = 323                            /* immediately returns kControlIconPart*/
  1307. };
  1308.  
  1309. /* Tagged data supported by icon controls */
  1310.  
  1311. enum {
  1312.     kControlIconTransformTag    = 'trfm',                        /* IconTransformType*/
  1313.     kControlIconAlignmentTag    = 'algn'                        /* IconAlignmentType*/
  1314. };
  1315.  
  1316. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1317. /*    • WINDOW HEADER (CDEF 21)                                                            */
  1318. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1319.  
  1320. enum {
  1321.                                                                 /* Window Header proc IDs */
  1322.     kControlWindowHeaderProc    = 336,                            /* normal header*/
  1323.     kControlWindowListViewHeaderProc = 337                        /* variant for list views - no bottom line*/
  1324. };
  1325.  
  1326. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1327. /*    • LIST BOX (CDEF 22)                                                                */
  1328. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1329. /*    Lists use an auxiliary resource to define their format. The resource type used is     */
  1330. /*    'ldes' and a definition for it can be found in Appearance.r. The resource ID for     */
  1331. /*    the ldes is passed in the 'value' parameter when creating the control.                */
  1332.  
  1333. enum {
  1334.                                                                 /* List Box proc IDs */
  1335.     kControlListBoxProc            = 352,
  1336.     kControlListBoxAutoSizeProc    = 353
  1337. };
  1338.  
  1339.  
  1340. enum {
  1341.                                                                 /* Tagged data supported by list box */
  1342.     kControlListBoxListHandleTag = 'lhan',                        /* ListHandle*/
  1343.     kControlListBoxKeyFilterTag    = kControlKeyFilterTag,            /* ControlKeyFilterUPP*/
  1344.     kControlListBoxFontStyleTag    = kControlFontStyleTag            /* ControlFontStyleRec*/
  1345. };
  1346.  
  1347. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1348. /*    • PUSH BUTTON (CDEF 23)                                                                */
  1349. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1350. /*    The new standard checkbox and radio button controls support a "mixed" value that    */
  1351. /*    indicates that the current setting contains a mixed set of on and off values. The     */
  1352. /*    control value used to display this indication is defined in Controls.h:                */
  1353. /*                                                                                        */
  1354. /*        kControlCheckBoxMixedValue = 2                                                    */
  1355. /*                                                                                        */
  1356. /*    Two new variants of the standard pushbutton have been added to the standard control    */
  1357. /*    suite that draw a color icon next to the control title. One variant draws the icon    */
  1358. /*    on the left side, the other draws it on the right side (when the system justifica-    */
  1359. /*    tion is right to left, these are reversed).                                            */
  1360. /*                                                                                        */
  1361. /*    When either of the icon pushbuttons are created, the contrlMax field of the control */
  1362. /*    record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    */
  1363. /*                                                                                        */
  1364. /*    In addition, a push button can now be told to draw with a default outline using the    */
  1365. /*    SetControlData routine with the kPushButtonDefaultTag below.                        */
  1366. /*                                                                                        */
  1367.  
  1368. enum {
  1369.                                                                 /* Theme Push Button/Check Box/Radio Button proc IDs */
  1370.     kControlPushButtonProc        = 368,
  1371.     kControlCheckBoxProc        = 369,
  1372.     kControlRadioButtonProc        = 370,
  1373.     kControlPushButLeftIconProc    = 374,                            /* Standard pushbutton with left-side icon*/
  1374.     kControlPushButRightIconProc = 375                            /* Standard pushbutton with right-side icon*/
  1375. };
  1376.  
  1377.  
  1378. enum {
  1379.                                                                 /* Tagged data supported by standard buttons */
  1380.     kControlPushButtonDefaultTag = 'dflt'                        /* default ring flag*/
  1381. };
  1382.  
  1383. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1384. /*    • SCROLL BAR (CDEF 24)                                                                */
  1385. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1386. /*    This is the new Appearance scroll bar.                                                */
  1387. /*                                                                                        */
  1388.  
  1389. enum {
  1390.                                                                 /* Theme Scroll Bar proc IDs */
  1391.     kControlScrollBarProc        = 384,                            /* normal scroll bar*/
  1392.     kControlScrollBarLiveProc    = 386                            /* live scrolling variant*/
  1393. };
  1394.  
  1395. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1396. /*    • POPUP BUTTON (CDEF 25)                                                            */
  1397. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1398. /*    This is the new Appearance Popup Button. It takes the same variants and does the     */
  1399. /*    same overloading as the previous popup menu control. There are some differences:    */
  1400. /*                                                                                        */
  1401. /*    Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    */
  1402. /*    resource. Instead, you can build the menu and later stuff the menuhandle field in     */
  1403. /*    the popup data information.                                                            */
  1404. /*                                                                                        */
  1405. /*    You can pass -1 in the Max parameter to have the control calculate the width of the    */
  1406. /*    title on its own instead of guessing and then tweaking to get it right. It adds the    */
  1407. /*    appropriate amount of space between the title and the popup.                        */
  1408. /*                                                                                        */
  1409.  
  1410. enum {
  1411.                                                                 /* Theme Popup Button proc IDs */
  1412.     kControlPopupButtonProc        = 400,
  1413.     kControlPopupFixedWidthVariant = 1 << 0,
  1414.     kControlPopupVariableWidthVariant = 1 << 1,
  1415.     kControlPopupUseAddResMenuVariant = 1 << 2,
  1416.     kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
  1417. };
  1418.  
  1419. /*——————————————————————————————————————————————————————————————————————————————————*/
  1420. /* Menu Manager constants, etc.                                                        */
  1421. /*——————————————————————————————————————————————————————————————————————————————————*/
  1422.  
  1423. enum {
  1424.     kMenuStdMenuProc            = 63,
  1425.     kMenuStdMenuBarProc            = 63
  1426. };
  1427.  
  1428.  
  1429. enum {
  1430.     kMenuNoModifiers            = 0,                            /* Mask for no modifiers*/
  1431.     kMenuShiftModifier            = (1 << 0),                        /* Mask for shift key modifier*/
  1432.     kMenuOptionModifier            = (1 << 1),                        /* Mask for option key modifier*/
  1433.     kMenuControlModifier        = (1 << 2),                        /* Mask for control key modifier*/
  1434.     kMenuNoCommandModifier        = (1 << 3)                        /* Mask for no command key modifier*/
  1435. };
  1436.  
  1437.  
  1438. enum {
  1439.     kMenuNoIcon                    = 0,                            /* No icon*/
  1440.     kMenuIconType                = 1,                            /* Type for ICON*/
  1441.     kMenuShrinkIconType            = 2,                            /* Type for ICON plotted 16 x 16*/
  1442.     kMenuSmallIconType            = 3,                            /* Type for SICN*/
  1443.     kMenuColorIconType            = 4,                            /* Type for cicn*/
  1444.     kMenuIconSuiteType            = 5,                            /* Type for Icon Suite*/
  1445.     kMenuIconRefType            = 6                                /* Type for Icon Ref*/
  1446. };
  1447.  
  1448. /*——————————————————————————————————————————————————————————————————————————————————*/
  1449. /*    Appearance Manager APIs                                                            */
  1450. /*——————————————————————————————————————————————————————————————————————————————————*/
  1451. /* Registering Appearance-Savvy Applications */
  1452. extern pascal OSStatus RegisterAppearanceClient(void)
  1453.  THREEWORDINLINE(0x303C, 0x0015, 0xAA74);
  1454.  
  1455. extern pascal OSStatus UnregisterAppearanceClient(void)
  1456.  THREEWORDINLINE(0x303C, 0x0016, 0xAA74);
  1457.  
  1458. /*
  1459. ****************************************************************************
  1460.     NOTES ON THEME BRUSHES
  1461.     Theme brushes can be either colors or patterns, depending on the theme.
  1462.     Because of this, you should be prepared to handle the case where a brush
  1463.     is a pattern and save and restore the pnPixPat and bkPixPat fields of
  1464.     your GrafPorts when saving the fore and back colors. Also, since patterns
  1465.     in bkPixPat override the background color of the window, you should use
  1466.     BackPat to set your background pattern to a normal white pattern. This
  1467.     will ensure that you can use RGBBackColor to set your back color to white,
  1468.     call EraseRect and get the expected results.
  1469. ****************************************************************************
  1470. */
  1471. extern pascal OSStatus SetThemePen(ThemeBrush brush, SInt16 depth, Boolean colorDevice)
  1472.  THREEWORDINLINE(0x303C, 0x0001, 0xAA74);
  1473.  
  1474. extern pascal OSStatus SetThemeBackground(ThemeBrush brush, SInt16 depth, Boolean colorDevice)
  1475.  THREEWORDINLINE(0x303C, 0x0002, 0xAA74);
  1476.  
  1477. extern pascal OSStatus SetThemeTextColor(ThemeTextColor color, SInt16 depth, Boolean colorDevice)
  1478.  THREEWORDINLINE(0x303C, 0x0003, 0xAA74);
  1479.  
  1480. extern pascal OSStatus SetThemeWindowBackground(WindowPtr window, ThemeBrush brush, Boolean update)
  1481.  THREEWORDINLINE(0x303C, 0x0004, 0xAA74);
  1482.  
  1483. /* Window Placards, Headers and Frames */
  1484. extern pascal OSStatus DrawThemeWindowHeader(const Rect *rect, ThemeDrawState state)
  1485.  THREEWORDINLINE(0x303C, 0x0005, 0xAA74);
  1486.  
  1487. extern pascal OSStatus DrawThemeWindowListViewHeader(const Rect *rect, ThemeDrawState state)
  1488.  THREEWORDINLINE(0x303C, 0x0006, 0xAA74);
  1489.  
  1490. extern pascal OSStatus DrawThemePlacard(const Rect *rect, ThemeDrawState state)
  1491.  THREEWORDINLINE(0x303C, 0x0007, 0xAA74);
  1492.  
  1493. extern pascal OSStatus DrawThemeEditTextFrame(const Rect *rect, ThemeDrawState state)
  1494.  THREEWORDINLINE(0x303C, 0x0009, 0xAA74);
  1495.  
  1496. extern pascal OSStatus DrawThemeListBoxFrame(const Rect *rect, ThemeDrawState state)
  1497.  THREEWORDINLINE(0x303C, 0x000A, 0xAA74);
  1498.  
  1499. /* Keyboard Focus Drawing */
  1500. extern pascal OSStatus DrawThemeFocusRect(const Rect *rect, Boolean hasFocus)
  1501.  THREEWORDINLINE(0x303C, 0x000B, 0xAA74);
  1502.  
  1503. /* Dialog Group Boxes and Separators */
  1504. extern pascal OSStatus DrawThemePrimaryGroup(const Rect *rect, ThemeDrawState state)
  1505.  THREEWORDINLINE(0x303C, 0x000C, 0xAA74);
  1506.  
  1507. extern pascal OSStatus DrawThemeSecondaryGroup(const Rect *rect, ThemeDrawState state)
  1508.  THREEWORDINLINE(0x303C, 0x000D, 0xAA74);
  1509.  
  1510. extern pascal OSStatus DrawThemeSeparator(const Rect *rect, ThemeDrawState state)
  1511.  THREEWORDINLINE(0x303C, 0x000E, 0xAA74);
  1512.  
  1513. /*——————————————————————————————————————————————————————————————————————————————————*/
  1514. /*    Window Manager APIs                                                                */
  1515. /*——————————————————————————————————————————————————————————————————————————————————*/
  1516. extern pascal OSStatus GetWindowFeatures(WindowPtr window, UInt32 *features)
  1517.  THREEWORDINLINE(0x303C, 0x0013, 0xAA74);
  1518.  
  1519. extern pascal Boolean IsWindowCollapsable(WindowPtr window)
  1520.  THREEWORDINLINE(0x303C, 0x000F, 0xAA74);
  1521.  
  1522. extern pascal Boolean IsWindowCollapsed(WindowPtr window)
  1523.  THREEWORDINLINE(0x303C, 0x0010, 0xAA74);
  1524.  
  1525. extern pascal OSStatus CollapseWindow(WindowPtr window, Boolean collapseIt)
  1526.  THREEWORDINLINE(0x303C, 0x0011, 0xAA74);
  1527.  
  1528. extern pascal OSStatus CollapseAllWindows(Boolean collapseEm)
  1529.  THREEWORDINLINE(0x303C, 0x0012, 0xAA74);
  1530.  
  1531. extern pascal OSStatus GetWindowRegion(WindowPtr window, WindowRegionCode regionCode, RgnHandle winRgn)
  1532.  THREEWORDINLINE(0x303C, 0x0014, 0xAA74);
  1533.  
  1534. /*——————————————————————————————————————————————————————————————————————————————————*/
  1535. /*    Dialog Manager APIs                                                                */
  1536. /*——————————————————————————————————————————————————————————————————————————————————*/
  1537. extern pascal DialogPtr NewFeaturesDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle itmLstHndl, UInt32 flags)
  1538.  THREEWORDINLINE(0x303C, 0x110C, 0xAA68);
  1539.  
  1540. extern pascal OSErr AutoSizeDialog(DialogPtr dialog)
  1541.  THREEWORDINLINE(0x303C, 0x020D, 0xAA68);
  1542.  
  1543. extern pascal OSErr StandardAlert(AlertType alertType, StringPtr error, StringPtr explanation, AlertStdAlertParamPtr alertParam, SInt16 *itemHit)
  1544.  THREEWORDINLINE(0x303C, 0x090E, 0xAA68);
  1545.  
  1546. extern pascal OSErr GetDialogItemAsControl(DialogPtr dialog, SInt16 itemNo, ControlHandle *control)
  1547.  THREEWORDINLINE(0x303C, 0x050F, 0xAA68);
  1548.  
  1549. extern pascal OSErr MoveDialogItem(DialogPtr dialog, SInt16 itemNo, SInt16 horiz, SInt16 vert)
  1550.  THREEWORDINLINE(0x303C, 0x0510, 0xAA68);
  1551.  
  1552. extern pascal OSErr SizeDialogItem(DialogPtr dialog, SInt16 itemNo, SInt16 height, SInt16 width)
  1553.  THREEWORDINLINE(0x303C, 0x0511, 0xAA68);
  1554.  
  1555. /*——————————————————————————————————————————————————————————————————————————————————*/
  1556. /*    Control Manager APIs                                                            */
  1557. /*——————————————————————————————————————————————————————————————————————————————————*/
  1558. /*
  1559.  These routines are available only thru the shared library/glue
  1560.  Bevel button routines
  1561. */
  1562. extern pascal OSErr GetBevelButtonMenuValue(ControlHandle button, SInt16 *value);
  1563.  
  1564. extern pascal OSErr SetBevelButtonMenuValue(ControlHandle button, SInt16 value);
  1565.  
  1566. extern pascal OSErr GetBevelButtonMenuHandle(ControlHandle button, MenuHandle *handle);
  1567.  
  1568. extern pascal OSErr GetBevelButtonContentInfo(ControlHandle button, ControlButtonContentInfoPtr content);
  1569.  
  1570. extern pascal OSErr SetBevelButtonContentInfo(ControlHandle button, ControlButtonContentInfoPtr content);
  1571.  
  1572. extern pascal OSErr SetBevelButtonTransform(ControlHandle button, IconTransformType transform);
  1573.  
  1574. extern pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle button, ControlButtonGraphicAlignment align, SInt16 hOffset, SInt16 vOffset);
  1575.  
  1576. extern pascal OSErr SetBevelButtonTextAlignment(ControlHandle button, ControlButtonTextAlignment align, SInt16 hOffset);
  1577.  
  1578. extern pascal OSErr SetBevelButtonTextPlacement(ControlHandle button, ControlButtonTextPlacement where);
  1579.  
  1580. /* Image well routines*/
  1581. extern pascal OSErr GetImageWellContentInfo(ControlHandle button, ControlButtonContentInfoPtr content);
  1582.  
  1583. extern pascal OSErr SetImageWellContentInfo(ControlHandle button, ControlButtonContentInfoPtr content);
  1584.  
  1585. extern pascal OSErr SetImageWellTransform(ControlHandle button, IconTransformType transform);
  1586.  
  1587. /* Tab routines*/
  1588. extern pascal OSErr GetTabContentRect(ControlHandle tabControl, Rect *contentRect);
  1589.  
  1590. extern pascal OSErr SetTabEnabled(ControlHandle tabControl, SInt16 tabToHilite, Boolean enabled);
  1591.  
  1592. /* Disclosure triangles*/
  1593. extern pascal OSErr SetDisclosureTriangleLastValue(ControlHandle tabControl, SInt16 value);
  1594.  
  1595. /* Trap-based routines*/
  1596. extern pascal SInt32 SendControlMessage(ControlHandle theControl, SInt16 message, SInt32 param)
  1597.  THREEWORDINLINE(0x303C, 0xFFFE, 0xAA73);
  1598.  
  1599. extern pascal OSErr DumpControlHierarchy(WindowPtr window, const FSSpec *outFile)
  1600.  THREEWORDINLINE(0x303C, 0xFFFF, 0xAA73);
  1601.  
  1602. extern pascal OSErr CreateRootControl(WindowPtr window, ControlHandle *control)
  1603.  THREEWORDINLINE(0x303C, 0x0001, 0xAA73);
  1604.  
  1605. extern pascal OSErr GetRootControl(WindowPtr window, ControlHandle *control)
  1606.  THREEWORDINLINE(0x303C, 0x0002, 0xAA73);
  1607.  
  1608. extern pascal OSErr EmbedControl(ControlHandle control, ControlHandle container)
  1609.  THREEWORDINLINE(0x303C, 0x0003, 0xAA73);
  1610.  
  1611. extern pascal OSErr AutoEmbedControl(ControlHandle control, WindowPtr window)
  1612.  THREEWORDINLINE(0x303C, 0x0004, 0xAA73);
  1613.  
  1614. extern pascal Boolean IsControlActive(ControlHandle control)
  1615.  THREEWORDINLINE(0x303C, 0x0005, 0xAA73);
  1616.  
  1617. extern pascal Boolean IsControlVisible(ControlHandle control)
  1618.  THREEWORDINLINE(0x303C, 0x0006, 0xAA73);
  1619.  
  1620. extern pascal OSErr ActivateControl(ControlHandle control)
  1621.  THREEWORDINLINE(0x303C, 0x0007, 0xAA73);
  1622.  
  1623. extern pascal OSErr DeactivateControl(ControlHandle control)
  1624.  THREEWORDINLINE(0x303C, 0x0008, 0xAA73);
  1625.  
  1626. extern pascal ControlHandle FindControlUnderMouse(Point where, WindowPtr window, SInt16 *part)
  1627.  THREEWORDINLINE(0x303C, 0x0009, 0xAA73);
  1628.  
  1629. extern pascal SInt16 HandleControlClick(ControlHandle control, Point where, SInt16 modifiers, ControlActionUPP action)
  1630.  THREEWORDINLINE(0x303C, 0x000A, 0xAA73);
  1631.  
  1632. extern pascal SInt16 HandleControlKey(ControlHandle control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers)
  1633.  THREEWORDINLINE(0x303C, 0x000B, 0xAA73);
  1634.  
  1635. extern pascal void IdleControls(WindowPtr window)
  1636.  THREEWORDINLINE(0x303C, 0x000C, 0xAA73);
  1637.  
  1638. extern pascal OSErr GetKeyboardFocus(WindowPtr window, ControlHandle *control)
  1639.  THREEWORDINLINE(0x303C, 0x000D, 0xAA73);
  1640.  
  1641. extern pascal OSErr SetKeyboardFocus(WindowPtr window, ControlHandle control, ControlFocusPart part)
  1642.  THREEWORDINLINE(0x303C, 0x000E, 0xAA73);
  1643.  
  1644. extern pascal OSErr AdvanceKeyboardFocus(WindowPtr window)
  1645.  THREEWORDINLINE(0x303C, 0x000F, 0xAA73);
  1646.  
  1647. extern pascal OSErr ReverseKeyboardFocus(WindowPtr window)
  1648.  THREEWORDINLINE(0x303C, 0x0010, 0xAA73);
  1649.  
  1650. extern pascal OSErr GetControlFeatures(ControlHandle control, UInt32 *features)
  1651.  THREEWORDINLINE(0x303C, 0x0011, 0xAA73);
  1652.  
  1653. extern pascal OSErr SetControlData(ControlHandle control, ControlPartCode part, ResType tagName, Size size, Ptr data)
  1654.  THREEWORDINLINE(0x303C, 0x0012, 0xAA73);
  1655.  
  1656. extern pascal OSErr GetControlData(ControlHandle control, ControlPartCode part, ResType tagName, Size bufferSize, Ptr buffer, Size *actualSize)
  1657.  THREEWORDINLINE(0x303C, 0x0013, 0xAA73);
  1658.  
  1659. extern pascal OSErr GetControlDataSize(ControlHandle control, ControlPartCode part, ResType tagName, Size *maxSize)
  1660.  THREEWORDINLINE(0x303C, 0x0014, 0xAA73);
  1661.  
  1662. extern pascal OSErr GetSuperControl(ControlHandle control, ControlHandle *parent)
  1663.  THREEWORDINLINE(0x303C, 0x0015, 0xAA73);
  1664.  
  1665. extern pascal OSErr CountSubControls(ControlHandle control, SInt16 *numChildren)
  1666.  THREEWORDINLINE(0x303C, 0x0016, 0xAA73);
  1667.  
  1668. extern pascal OSErr GetIndexedSubControl(ControlHandle control, SInt16 index, ControlHandle *subControl)
  1669.  THREEWORDINLINE(0x303C, 0x0017, 0xAA73);
  1670.  
  1671. extern pascal void DrawControlInCurrentPort(ControlHandle theControl)
  1672.  THREEWORDINLINE(0x303C, 0x0018, 0xAA73);
  1673.  
  1674. extern pascal OSErr ClearKeyboardFocus(WindowPtr window)
  1675.  THREEWORDINLINE(0x303C, 0x0019, 0xAA73);
  1676.  
  1677. extern pascal OSErr SetControlSupervisor(ControlHandle control, ControlHandle boss)
  1678.  THREEWORDINLINE(0x303C, 0x001A, 0xAA73);
  1679.  
  1680. extern pascal OSErr GetBestControlRect(ControlHandle control, Rect *rect, SInt16 *baseLineOffset)
  1681.  THREEWORDINLINE(0x303C, 0x001B, 0xAA73);
  1682.  
  1683. extern pascal OSErr SetControlFontStyle(ControlHandle control, ControlFontStyleRec *style)
  1684.  THREEWORDINLINE(0x303C, 0x001C, 0xAA73);
  1685.  
  1686. extern pascal OSErr SetUpControlBackground(ControlHandle control, SInt16 depth, Boolean colorDevice)
  1687.  THREEWORDINLINE(0x303C, 0x001D, 0xAA73);
  1688.  
  1689. extern pascal OSErr SetControlVisibility(ControlHandle control, Boolean isVisible, Boolean draw)
  1690.  THREEWORDINLINE(0x303C, 0x001E, 0xAA73);
  1691.  
  1692. /*——————————————————————————————————————————————————————————————————————————————————*/
  1693. /*    Menu Manager APIs                                                                */
  1694. /*——————————————————————————————————————————————————————————————————————————————————*/
  1695. extern pascal UInt32 MenuEvent(const EventRecord *event)
  1696.  THREEWORDINLINE(0x303C, 0x020C, 0xA825);
  1697.  
  1698. extern pascal OSErr SetMenuItemCommandID(MenuHandle menu, SInt16 item, UInt32 commandID)
  1699.  THREEWORDINLINE(0x303C, 0x0502, 0xA825);
  1700.  
  1701. extern pascal OSErr GetMenuItemCommandID(MenuHandle menu, SInt16 item, UInt32 *commandID)
  1702.  THREEWORDINLINE(0x303C, 0x0503, 0xA825);
  1703.  
  1704. extern pascal OSErr SetMenuItemModifiers(MenuHandle menu, SInt16 item, UInt8 modifiers)
  1705.  THREEWORDINLINE(0x303C, 0x0404, 0xA825);
  1706.  
  1707. extern pascal OSErr GetMenuItemModifiers(MenuHandle menu, SInt16 item, UInt8 *modifiers)
  1708.  THREEWORDINLINE(0x303C, 0x0505, 0xA825);
  1709.  
  1710. extern pascal OSErr SetMenuItemIconHandle(MenuHandle menu, SInt16 item, UInt8 iconType, Handle icon)
  1711.  THREEWORDINLINE(0x303C, 0x0606, 0xA825);
  1712.  
  1713. extern pascal OSErr GetMenuItemIconHandle(MenuHandle menu, SInt16 item, UInt8 *iconType, Handle *icon)
  1714.  THREEWORDINLINE(0x303C, 0x0707, 0xA825);
  1715.  
  1716. extern pascal OSErr SetMenuItemTextEncoding(MenuHandle menu, SInt16 item, TextEncoding scriptID)
  1717.  THREEWORDINLINE(0x303C, 0x0408, 0xA825);
  1718.  
  1719. extern pascal OSErr GetMenuItemTextEncoding(MenuHandle menu, SInt16 item, TextEncoding *scriptID)
  1720.  THREEWORDINLINE(0x303C, 0x0509, 0xA825);
  1721.  
  1722. extern pascal OSErr SetMenuItemHierarchicalID(MenuHandle menu, SInt16 item, SInt16 hierID)
  1723.  THREEWORDINLINE(0x303C, 0x040D, 0xA825);
  1724.  
  1725. extern pascal OSErr GetMenuItemHierarchicalID(MenuHandle menu, SInt16 item, SInt16 *hierID)
  1726.  THREEWORDINLINE(0x303C, 0x050E, 0xA825);
  1727.  
  1728. extern pascal OSErr SetMenuItemFontID(MenuHandle menu, SInt16 item, SInt16 fontID)
  1729.  THREEWORDINLINE(0x303C, 0x040F, 0xA825);
  1730.  
  1731. extern pascal OSErr GetMenuItemFontID(MenuHandle menu, SInt16 item, SInt16 *fontID)
  1732.  THREEWORDINLINE(0x303C, 0x0510, 0xA825);
  1733.  
  1734. extern pascal OSErr SetMenuItemRefCon(MenuHandle menu, SInt16 item, UInt32 refCon)
  1735.  THREEWORDINLINE(0x303C, 0x050A, 0xA825);
  1736.  
  1737. extern pascal OSErr GetMenuItemRefCon(MenuHandle menu, SInt16 item, UInt32 *refCon)
  1738.  THREEWORDINLINE(0x303C, 0x050B, 0xA825);
  1739.  
  1740. extern pascal OSErr SetMenuItemRefCon2(MenuHandle menu, SInt16 item, UInt32 refCon2)
  1741.  THREEWORDINLINE(0x303C, 0x0511, 0xA825);
  1742.  
  1743. extern pascal OSErr GetMenuItemRefCon2(MenuHandle menu, SInt16 item, UInt32 *refCon2)
  1744.  THREEWORDINLINE(0x303C, 0x0512, 0xA825);
  1745.  
  1746. extern pascal OSErr SetMenuItemKeyGlyph(MenuHandle menu, SInt16 item, SInt16 glyph)
  1747.  THREEWORDINLINE(0x303C, 0x0513, 0xA825);
  1748.  
  1749. extern pascal OSErr GetMenuItemKeyGlyph(MenuHandle menu, SInt16 item, SInt16 *glyph)
  1750.  THREEWORDINLINE(0x303C, 0x0514, 0xA825);
  1751.  
  1752.  
  1753. #if PRAGMA_ALIGN_SUPPORTED
  1754. #pragma options align=reset
  1755. #endif
  1756.  
  1757. #if PRAGMA_IMPORT_SUPPORTED
  1758. #pragma import off
  1759. #endif
  1760.  
  1761. #ifdef __cplusplus
  1762. }
  1763. #endif
  1764.  
  1765. #endif /* __APPEARANCE__ */
  1766.  
  1767.